package cn.edu.lcu.cs.javateaching.gui;

//import static org.hamcrest.CoreMatchers.either;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;

public class HelloFrame {

	public static void main(String[] args) {
		SwingUtilities.invokeLater(HelloFrame::init);
	}

	private static void init() {
		JFrame frame = new JFrame("Hello world");
		frame.setSize(400, 200);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);

		JDialog dialog = new JDialog(frame, "Login", false);

		dialog.setSize(200, 100);
		dialog.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
		dialog.setVisible(true);

		JButton loginBtn = new JButton("登录");
		loginBtn.addActionListener((e) -> {
			System.out.println(e.getActionCommand());
		});
		dialog.add(loginBtn);
	}

}
